package com.kgc.scd.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.kgc.scd.bean.Comment;
import com.kgc.scd.bean.CommentExample;
import com.kgc.scd.bean.Order;
import com.kgc.scd.bean.OrderItemExample;
import com.kgc.scd.mapper.CommentMapper;
import com.kgc.scd.service.CommentService;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created On : 2022/6/15.
 * <p>
 * Author     : hi
 * <p>
 * Description: CommentServiceImpl
 */
@Slf4j
@Service
public class CommentServiceImpl implements CommentService {

    @Autowired(required = false)
    private CommentMapper commentMapper;

    /**
     *添加评论
     */

    @Override
    public int addComment(Comment comment) {

        return commentMapper.insert(comment);
    }

    /**
     *查询追评
     */
    @Override
    public Comment selectcomadd(@Param("commProid")String commProid , @Param("orderId") String orderId) {
        return commentMapper.selectCommAdd(commProid,orderId);
    }

    /**
     *插入追评
     */
    @Override
    public void addsuperaddition(Comment comment) {
      commentMapper.updateByPrimaryKeySelective(comment);
    }

}
